<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
        <title>订餐 - {{ user.last_name }}</title>
    </head>
    <body>
        <h1>餐馆</h1>
        <ul id="restaurant">
            {% for resta in restaurants_list %}
            <li><a href="{% url rest_courses resta.id %}">{{ resta.name }}</a> ({{ resta.get_course_type_display }})</a></li>
            {% endfor %}
        </ul>     
                
        <h1>历史订餐记录</h1>
        <table id="order">
            {% for order in order_list %}
            <tr>
            <td>{{order.dt|date:"Y-m-d  H:i:s"}}</td>
            <td>{{ order.course.resta.name }}</td>
            <td><a href="{% url set_order order.course.id %}" title='点击订餐'>{{ order.course.name }}</a></td>
            <td>{{ order.course.price }}元</td>
            <td><a href="{% url del_order order.id %}">删除</a></td>
            </tr>
            {% endfor %}
        </table>
        <p>最贵 {{max_p}}元,  最便宜 {{min_p}}元,  平均 {{avg_p}}元/餐,  订单数 {{cnt_p}},  总计 {{sum_p}}元</p>
        {% include 'message.html' %}
        
        <h2><a href="{% url today_order %}">查看当日所有订餐记录</a></h2>
        <hr />
        
        <p>您已经用 {{ user }} 登陆成功 <a href="{% url acct_logout_and_login %}">注销</a></p>
    </body>
    
</html>